package com.java.base.exercise.aysn;

/**
 * @Author RenPu
 * @Date 2023/5/10 11:41
 * @Version 1.0
 * @Description:
 **/

public enum ThreadPoolEnum {

    DEFAULT("default", 10, 20, 100);

    private final String name; // 线程池名称
    private final int corePoolSize; // 核心线程数
    private final int maxPoolSize; // 最大线程数
    private final int queueCapacity; // 队列容量

    ThreadPoolEnum(String name, int corePoolSize, int maxPoolSize, int queueCapacity) {
        this.name = name;
        this.corePoolSize = corePoolSize;
        this.maxPoolSize = maxPoolSize;
        this.queueCapacity = queueCapacity;
    }

    public String getName() {
        return name;
    }

    public int getCorePoolSize() {
        return corePoolSize;
    }

    public int getMaxPoolSize() {
        return maxPoolSize;
    }

    public int getQueueCapacity() {
        return queueCapacity;
    }

    @Override
    public String toString() {
        return "ThreadPoolEnum{" +
                "name='" + name + '\'' +
                ", corePoolSize=" + corePoolSize +
                ", maxPoolSize=" + maxPoolSize +
                ", queueCapacity=" + queueCapacity +
                '}';
    }
}

